package com.shujia.jinjie;
import com.aliyun.tea.*;
import com.shujia.utils.CodeTool;
import com.shujia.utils.RedisTool;
import com.shujia.utils.TemplateCodeModel;
import redis.clients.jedis.JedisCluster;

import java.util.Set;

public class CodeTest {
    public static void main(String[] args) {
        String code = CodeTool.createCode();
        JedisCluster jedisCluster = RedisTool.getConnection();
        jedisCluster.setex("yzm_17354074069", 60, code);
        boolean b = CodeTool.sendCode("17354074069", TemplateCodeModel.TEMP_31, code);
        if(b){
            System.out.println("----------------"+code+"-------------------");
            String redisCode = jedisCluster.get("yzm_17354074069");
            System.out.println("============="+redisCode+"============");
            System.out.println("验证码发送成功！");
        }else {
            System.out.println("验证码发送失败！");
        }

    }
}
